//
//  LHPickView.h
//  lhpc
//
//  Created by 赵永杰 on 17/3/8.
//  Copyright © 2017年 lhpc. All rights reserved.
//

#import <UIKit/UIKit.h>
@class LHPickView;

@protocol LHPickViewDataSource <NSObject>

@required

- (NSInteger)numberOfComponentsInPickerView:(LHPickView *)pickerView;

- (NSInteger)pickerView:(LHPickView *)pickerView numberOfRowsInComponent:(NSInteger)component;

@end

@protocol LHPickViewDelegate <NSObject>

- (NSString *)pickerView:(LHPickView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;

- (void)pickView:(LHPickView *)pickerView confirmButtonClick:(UIButton *)button;

@optional
- (NSAttributedString *)pickerView:(LHPickView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)componen;

- (void)pickerView:(LHPickView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;


@end

@interface LHPickView : UIView

@property (nonatomic, weak) id<LHPickViewDelegate> delegate;
@property (nonatomic, weak) id<LHPickViewDataSource> dataSource;
- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title;
- (void)show;
- (void)dismiss;
// 选中某一行
- (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated;
// 获取当前选中的row
- (NSInteger)selectedRowInComponent:(NSInteger)component;

//刷新某列数据
-(void)pickReloadComponent:(NSInteger)component;
//刷新数据
-(void)reloadData;
@end
